package com.hello.tong.service.impl;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.hello.tong.entity.Account;
import com.hello.tong.mapper.AccountMapper;
import com.hello.tong.service.IAccountService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author tong-exists
 * @since 2022-12-31
 */
@Service
@Slf4j
public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> implements IAccountService {

    @Autowired
    private AccountMapper accountMapper;

    @Override
    public void debit(String userId, int money) {
        log.info("debit...");
        accountMapper.updateMoneyByUserId(userId, money);
    }
}
